#include "../Base/stdafx.h"
#include "../Base/DXDevice.h"
#include "ModelLib.h"

ModelLib* ModelLib::m_SingletonPtr = 0;

ModelLib* ModelLib::GetSingleton()
{
	if(!m_SingletonPtr)
		m_SingletonPtr = new ModelLib();
	return m_SingletonPtr;
}

ModelLib::ModelLib()
{
	
}

ModelLib::~ModelLib()
{
	//for_each(m_Models.begin(), m_Models.end(), Model::Deleter);
	m_Models.empty();
}

TreeNode* ModelLib::CreateModel(const tstring &model, const tstring &texture)
{
	//if(m_Models.find(model) != m_Models.end())
	//{
	//	m_Models.find(model)->second->ResetActor();
	//	return m_Models.find(model)->second;
	//}
	//else
	//{
	//	XMesh* temp;
	//	if(texture == _T(""))
	//		temp = new XMesh(model, _T("./Textures/WhiteTex.dds"));
	//	else
	//		temp = new XMesh(model, texture);

	//	temp->InLib();
	//	m_Models.insert(make_pair(model, temp));
	//	return temp;
	//}
	return NULL;
}